from rest_framework.serializers import ModelSerializer
from .models import *


class NewsSer(ModelSerializer):
    class Meta:
        model = News
        fields = '__all__'


class XWser(ModelSerializer):
    class Meta:
        model = Advertisement
        fields = '__all__'


class Userser(ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'


class AddSer(ModelSerializer):
    class Meta:
        model = Address
        fields = '__all__'

class AreaSer(ModelSerializer):
    class Meta:
        model = Area
        fields = '__all__'

class ShowAddSer(ModelSerializer):
    province = AreaSer()
    city = AreaSer()
    area = AreaSer()
    class Meta:
        model = Address
        fields = '__all__'

class TeaSer(ModelSerializer):
    class Meta:
        model = Teacher
        fields = '__all__'

class StuSer(ModelSerializer):
    class Meta:
        model = Student
        fields = '__all__'